﻿using LiveCharts;
using LiveCharts.Defaults;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zhaoxi.HeatExchange.Controls;

namespace Zhaoxi.HeatExchange.Models
{
    public class MainModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler? PropertyChanged;

        private bool _pump1State;

        public bool Pump1State
        {
            get { return _pump1State; }
            set
            {
                _pump1State = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Pump1State"));
            }
        }

        public ChartValues<ObservableValue> HistoryValues { get; set; }

        public ObservableCollection<ItemModel> MomentDataList { get; set; }
        public MainModel()
        {
            MomentDataList = new ObservableCollection<ItemModel>();
            MomentDataList.Add(new ItemModel { Name = "瞬时流量", Value = 0, Unit = "m³" });
            MomentDataList.Add(new ItemModel { Name = "瞬时热量", Value = 0, Unit = "Gj" });


            HistoryValues = new ChartValues<ObservableValue>();
            //09,223,03,07,335,440,178
            HistoryValues.Add(new ObservableValue(9));
            HistoryValues.Add(new ObservableValue(223));
            HistoryValues.Add(new ObservableValue(3));
            HistoryValues.Add(new ObservableValue(7));
            HistoryValues.Add(new ObservableValue(335));
            HistoryValues.Add(new ObservableValue(440));
            HistoryValues.Add(new ObservableValue(178));
        }
    }
}
